<!doctype html>
<html lang="ru" data-bs-theme="dark">

<head>
    <!-- 2024-05-11 14:14:06 -->
        <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>git restore</title>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/css/bootstrap.min.css" integrity="sha512-jnSuA4Ss2PkkikSOLtYs8BlYIeeIK1h99ty4YfvRPAlzr377vr3CXDb7sb7eEEBYjDtcYj+AjBH3FLv5uSJuXg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.11.3/font/bootstrap-icons.min.css" integrity="sha512-dPXYcDub/aeb08c63jRq/k6GaKccl256JQy/AnOq7CAnEZ9FzSL9wSbcZkMp4R26vBsMLFYH4kQ67/bbV8XaCQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css" integrity="sha512-rO+olRTkcf304DQBxSWxln8JXCzTHlKnIdnMUwYvQa9/Jd4cQaNkItIUj6Z4nvW1dqK0SKXLbn9h4KwZTNtAyw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/7.1.0/css/flag-icons.min.css" integrity="sha512-bZBu2H0+FGFz/stDN/L0k8J0G8qVsAL0ht1qg5kTwtAheiXwiRKyCq1frwfbSFSJN3jooR5kauE0YjtPzhZtJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link href="../../../runebook.css" rel="stylesheet" type="text/css">
    <meta name="x-github" content="https://github.com/runebookdev/runebook">
            <meta name="x-i18n-doc" content="git">
        <script>
        function i18n(element) {
            // NOP
        }
    </script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/3.0.5/js.cookie.js" integrity="sha512-F/dia2jKME12jwqiYDayeD+Rr/8jTWUD2wfbuJB0bzSwenSEnXsn4qQ/wVyXUCix5bmCAj8xJdtFr2OqUtjLAw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/js/bootstrap.bundle.min.js" integrity="sha512-7Pi/otdlbbCR+LnW+F7PwFcSDJOuUJB3OxtEHbg4vSMvzvJjde4Po1v4BR9Gdc9aXNUNFVUY+SK51wWT8WF0Gg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/7.8.1/rxjs.umd.min.js" integrity="sha512-D9LDs8YUUVa4V9Gl4Zb+xqRAc7RCzooR3+zzebgK2RMu/KU+dh90pbjEEMzPiSyRSGbSp9j1pZnrO4joGa5WEg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js" integrity="sha512-mhbv5DqBMgrWL+32MmsDOt/OAvqr/cHimk6B8y/bx/xS88MVkYGPiVv2ixKVrkywF2qHplNRUvFsAHUdxZ3Krg==" crossorigin="anonymous"></script>
    <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6424571640879890" crossorigin="anonymous"></script>    <script async src="https://www.googletagmanager.com/gtag/js?id=G-3G5BZ1QEDP"></script>
<script>
    window.dataLayer = window.dataLayer || [];

    function gtag() {
        dataLayer.push(arguments);
    }

    gtag('js', new Date());
    gtag('config', 'G-3G5BZ1QEDP');
</script>    <script>
(function(c, l, a, r, i, t, y) {
    c[a] = c[a] || function() {
        (c[a].q = c[a].q || []).push(arguments)
    };
    t = l.createElement(r);
    t.async = 1;
    t.src = "https://www.clarity.ms/tag/" + i + "?ref=bwt";
    y = l.getElementsByTagName(r)[0];
    y.parentNode.insertBefore(t, y);
})(window, document, "clarity", "script", "jto2hd94r9");
</script>    <script src="../../../theme.js"></script>
</head>

<body>
    <header class="bg-black">
        <div class="container">
            <div class="row">
                <div class="col">
                    <nav class="navbar navbar-expand-lg navbar-dark">
                        <a class="navbar-brand fw-bold" href="https://runebook.dev/ru">
                            <img alt="Runebook.dev" class="d-inline-block align-top mr-1" src="../../../assets/runebook_logo.webp" width="24" height="24">
                            Runebook.dev
                        </a>
                        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                            <span class="navbar-toggler-icon"></span>
                        </button>
                        <div class="collapse navbar-collapse" id="navbarSupportedContent">
                            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                                <li class="nav-item">
                                    <a class="nav-link" href="https://runebook.dev/ru#docs">Documentation</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="https://runebook.dev/contributors">Contributors</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="https://github.com/runebookdev/runebook/issues">GitHub</a>
                                </li>
                            </ul>
                                                                                                <button class="btn btn-success ms-2" id="showPopupButton">
                                        <i class="bi bi-translate"></i>
                                        Show English
                                    </button>
                                                                                        <div class="form-check form-switch ms-3">
                                <label class="text-light">
                                    <input class="form-check-input" type="checkbox" role="switch" id="theme-switch" checked>
                                    <i class="bi bi-moon-stars-fill"></i>
                                </label>
                            </div>
                        </div>
                    </nav>
                </div>
            </div>
        </div>
    </header>

    <!--sse-->
    <div class="container">
    <div class="row">
        <div class="col">
            <nav aria-label="breadcrumb" class="mt-2">
                <ol class="breadcrumb mb-1">
                    <li class="breadcrumb-item">
                        <a href="https://runebook.dev/ru#docs">
                            <span class="fi fi-ru"></span>                            Русский                        </a>
                    </li>
                    <li class="breadcrumb-item">
                        <a href="-index-.html">
                            Git                            2.43                        </a>
                    </li>
                                            <li class="breadcrumb-item">
                            <a href="-index-.html#Basic_Snapshotting">
                                Basic Snapshotting                            </a>
                        </li>
                                    </ol>
            </nav>
        </div>
    </div>
    <br>

    <div class="row">
        <div class="col-md-9">
            <main>
                <article>

                    
                    <h1 class="text-body-emphasis" ><span data-i18n="31e02948278723610e573dfb00f698fa152b39fac101481be0c8adfc12b20ea5/b9" data-source="git-restore" onmousemove="i18n(this)">git-restore</span></h1> <h2 class="text-body-emphasis"  id="_name"><span data-i18n="dcd1d5223f73b3a965c07e3ff5dbee3eedcfedb806686a05b9b3868a2c3d6d50/3a" data-source="Name" onmousemove="i18n(this)">Name</span></h2> <div> <p><span data-i18n="b84be32ab7122162397300d8734fc565df9ee5e1abf9edc23ee00f24572fa1aa/0d" data-source="git-restore - Restore working tree files" onmousemove="i18n(this)">git-restore &mdash; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&icy;&tcy;&softcy; &fcy;&acy;&jcy;&lcy;&ycy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&gcy;&ocy; &dcy;&iecy;&rcy;&iecy;&vcy;&acy;</span></p> </div> <h2 class="text-body-emphasis"  id="_synopsis"><span data-i18n="8eb3755381519d7f0479d75446e56e20084834c0460d7ec94926932372ea6c47/0d" data-source="Synopsis" onmousemove="i18n(this)">Synopsis</span></h2> <div> <div> <pre class="hljs language-xml">git restore [<span class="hljs-tag">&lt;<span class="hljs-name">options</span>&gt;</span>] [--source=<span class="hljs-tag">&lt;<span class="hljs-name">tree</span>&gt;</span>] [--staged] [--worktree] [--] <span class="hljs-tag">&lt;<span class="hljs-name">pathspec</span>&gt;</span>&hellip;&ZeroWidthSpace;
git restore [<span class="hljs-tag">&lt;<span class="hljs-name">options</span>&gt;</span>] [--source=<span class="hljs-tag">&lt;<span class="hljs-name">tree</span>&gt;</span>] [--staged] [--worktree] --pathspec-from-file=<span class="hljs-tag">&lt;<span class="hljs-name">file</span>&gt;</span> [--pathspec-file-nul]
git restore (-p|--patch) [<span class="hljs-tag">&lt;<span class="hljs-name">options</span>&gt;</span>] [--source=<span class="hljs-tag">&lt;<span class="hljs-name">tree</span>&gt;</span>] [--staged] [--worktree] [--] [<span class="hljs-tag">&lt;<span class="hljs-name">pathspec</span>&gt;</span>&hellip;&ZeroWidthSpace;]</pre> </div> </div> <h2 class="text-body-emphasis"  id="_description"><span data-i18n="526e0087cc3f254d9f86f6c7d8e23d954c4dfda2b312efc29194ae8a860106ba/d3" data-source="Description" onmousemove="i18n(this)">Description</span></h2> <div> <p><span data-i18n="23ee0585b7bd23d9e24e8ce175d266725a0846362c23976a9de772b53e492291/f5" data-source="Restore specified paths in the working tree with some contents from a restore source. If a path is tracked but does not exist in the restore source, it will be removed to match the source." onmousemove="i18n(this)">&Vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&icy;&tcy;&softcy; &ucy;&kcy;&acy;&zcy;&acy;&ncy;&ncy;&ycy;&iecy; &pcy;&ucy;&tcy;&icy; &vcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy; &scy; &ncy;&iecy;&kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&mcy; &scy;&ocy;&dcy;&iecy;&rcy;&zhcy;&icy;&mcy;&ycy;&mcy; &icy;&zcy; &icy;&scy;&tcy;&ocy;&chcy;&ncy;&icy;&kcy;&acy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;&icy;&yacy;. &IEcy;&scy;&lcy;&icy; &pcy;&ucy;&tcy;&softcy; &ocy;&tcy;&scy;&lcy;&iecy;&zhcy;&icy;&vcy;&acy;&iecy;&tcy;&scy;&yacy;, &ncy;&ocy; &ncy;&iecy; &scy;&ucy;&shchcy;&iecy;&scy;&tcy;&vcy;&ucy;&iecy;&tcy; &vcy; &icy;&scy;&tcy;&ocy;&chcy;&ncy;&icy;&kcy;&iecy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;&icy;&yacy;, &ocy;&ncy; &bcy;&ucy;&dcy;&iecy;&tcy; &ucy;&dcy;&acy;&lcy;&iecy;&ncy;, &chcy;&tcy;&ocy;&bcy;&ycy; &scy;&ocy;&ocy;&tcy;&vcy;&iecy;&tcy;&scy;&tcy;&vcy;&ocy;&vcy;&acy;&tcy;&softcy; &icy;&scy;&tcy;&ocy;&chcy;&ncy;&icy;&kcy;&ucy;.</span></p> <p><span data-i18n="4b89287dbb92d04e4c6a25d6567502899099fa8d170064d3136ad87ec54090bc/f5" data-source="The command can also be used to restore the content in the index with &lt;code&gt;--staged&lt;/code&gt;, or restore both the working tree and the index with &lt;code&gt;--staged --worktree&lt;/code&gt;." onmousemove="i18n(this)">&Ecy;&tcy;&ucy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ucy; &tcy;&acy;&kcy;&zhcy;&iecy; &mcy;&ocy;&zhcy;&ncy;&ocy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&tcy;&softcy; &dcy;&lcy;&yacy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;&icy;&yacy; &scy;&ocy;&dcy;&iecy;&rcy;&zhcy;&icy;&mcy;&ocy;&gcy;&ocy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&acy; &scy; &pcy;&ocy;&mcy;&ocy;&shchcy;&softcy;&yucy;  <code>--staged</code>  &icy;&lcy;&icy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;&icy;&yacy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&gcy;&ocy; &dcy;&iecy;&rcy;&iecy;&vcy;&acy; &icy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&acy; &scy; &pcy;&ocy;&mcy;&ocy;&shchcy;&softcy;&yucy;  <code>--staged --worktree</code> .</span></p> <p><span data-i18n="8333c584bd52f9917bb43b9ac2deedaf98cc1d5ce44c2f6aeb9d5b87adc4db52/51" data-source="By default, if &lt;code&gt;--staged&lt;/code&gt; is given, the contents are restored from &lt;code&gt;HEAD&lt;/code&gt;, otherwise from the index. Use &lt;code&gt;--source&lt;/code&gt; to restore from a different commit." onmousemove="i18n(this)">&Pcy;&ocy; &ucy;&mcy;&ocy;&lcy;&chcy;&acy;&ncy;&icy;&yucy;, &iecy;&scy;&lcy;&icy; &ucy;&kcy;&acy;&zcy;&acy;&ncy;  <code>--staged</code> , &scy;&ocy;&dcy;&iecy;&rcy;&zhcy;&icy;&mcy;&ocy;&iecy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&acy;&vcy;&lcy;&icy;&vcy;&acy;&iecy;&tcy;&scy;&yacy; &icy;&zcy;  <code>HEAD</code> , &vcy; &pcy;&rcy;&ocy;&tcy;&icy;&vcy;&ncy;&ocy;&mcy; &scy;&lcy;&ucy;&chcy;&acy;&iecy; &mdash; &icy;&zcy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&acy;. &Icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ucy;&jcy;&tcy;&iecy;  <code>--source</code>  &dcy;&lcy;&yacy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;&icy;&yacy; &icy;&zcy; &dcy;&rcy;&ucy;&gcy;&ocy;&gcy;&ocy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&acy;.</span></p> <p><span data-i18n="465463e46081ba85fcd60b7d2bdfd9e4c6922ac704c441a1afd9ef1e011b3450/cd" data-source="See &amp;quot;Reset, restore and revert&amp;quot; in &lt;a href=&quot;git&quot;&gt;git[1]&lt;/a&gt; for the differences between the three commands." onmousemove="i18n(this)">&Scy;&mcy;.  &quot;Reset, restore and revert&quot;  &vcy;  <a href="git.html">git[1]</a> , &chcy;&tcy;&ocy;&bcy;&ycy; &ucy;&zcy;&ncy;&acy;&tcy;&softcy; &ocy; &rcy;&acy;&zcy;&lcy;&icy;&chcy;&icy;&yacy;&khcy; &mcy;&iecy;&zhcy;&dcy;&ucy; &tcy;&rcy;&iecy;&mcy;&yacy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&acy;&mcy;&icy;.</span></p> <p><span data-i18n="acb8be731fb216e8d1d38339666f6db08ffb5752fbd8321252c74afc24344cdb/a9" data-source="THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE." onmousemove="i18n(this)">&Ecy;&Tcy;&Acy; &Kcy;&Ocy;&Mcy;&Acy;&Ncy;&Dcy;&Acy; &Ecy;&Kcy;&Scy;&Pcy;&IEcy;&Rcy;&Icy;&Mcy;&IEcy;&Ncy;&Tcy;&Acy;&Lcy;&SOFTcy;&Ncy;&Acy;&YAcy;. &Pcy;&Ocy;&Vcy;&IEcy;&Dcy;&IEcy;&Ncy;&Icy;&IEcy; &Mcy;&Ocy;&ZHcy;&IEcy;&Tcy; &Icy;&Zcy;&Mcy;&IEcy;&Ncy;&Icy;&Tcy;&SOFTcy;&Scy;&YAcy;.</span></p> </div> <h2 class="text-body-emphasis"  id="_options"><span data-i18n="d0db8b5e364b6989e4b8f38a2b3846b87d99a51c1592ebf35d21cc66405a8e39/b6" data-source="Options" onmousemove="i18n(this)">Options</span></h2> <div> <div> <dl> <dt id="Documentation/git-restore.txt--slttreegt"><span data-i18n="eddc24761c1c983b0cdf73e8f523817148992a98578cd722be08df3a2d00f4e9/79" data-source="-s &amp;lt;tree&amp;gt;" onmousemove="i18n(this)">-s &lt;tree&gt;</span></dt> <dt id="Documentation/git-restore.txt---sourcelttreegt"><span data-i18n="f75e1b60421f1dd748e5cea00c57d303cc97a7a0da642daea75e8e41a40ffa6f/6d" data-source="--source=&amp;lt;tree&amp;gt;" onmousemove="i18n(this)">--source=&lt;tree&gt;</span></dt> <dd> <p><span data-i18n="f40b124b47b6ab816495f4276ceea5c81c48f3efa9772e883d0fe30c79487319/e0" data-source="Restore the working tree files with the content from the given tree. It is common to specify the source tree by naming a commit, branch or tag associated with it." onmousemove="i18n(this)">&Vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&icy;&tcy;&iecy; &fcy;&acy;&jcy;&lcy;&ycy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&gcy;&ocy; &dcy;&iecy;&rcy;&iecy;&vcy;&acy; &scy; &scy;&ocy;&dcy;&iecy;&rcy;&zhcy;&icy;&mcy;&ycy;&mcy; &dcy;&acy;&ncy;&ncy;&ocy;&gcy;&ocy; &dcy;&iecy;&rcy;&iecy;&vcy;&acy;. &Ocy;&bcy;&ycy;&chcy;&ncy;&ocy; &icy;&scy;&khcy;&ocy;&dcy;&ncy;&ocy;&iecy; &dcy;&iecy;&rcy;&iecy;&vcy;&ocy; &ucy;&kcy;&acy;&zcy;&ycy;&vcy;&acy;&iecy;&tcy;&scy;&yacy; &pcy;&ucy;&tcy;&iecy;&mcy; &ucy;&kcy;&acy;&zcy;&acy;&ncy;&icy;&yacy; &scy;&vcy;&yacy;&zcy;&acy;&ncy;&ncy;&ocy;&gcy;&ocy; &scy; &ncy;&icy;&mcy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&acy;, &vcy;&iecy;&tcy;&kcy;&icy; &icy;&lcy;&icy; &tcy;&iecy;&gcy;&acy;.</span></p> <p><span data-i18n="0bdfed1092c67c96624976569d56ab218e1de66a9eebebc664f602853af60d43/66" data-source="If not specified, the contents are restored from &lt;code&gt;HEAD&lt;/code&gt; if &lt;code&gt;--staged&lt;/code&gt; is given, otherwise from the index." onmousemove="i18n(this)">&IEcy;&scy;&lcy;&icy; &ncy;&iecy; &ucy;&kcy;&acy;&zcy;&acy;&ncy;&ocy;, &scy;&ocy;&dcy;&iecy;&rcy;&zhcy;&icy;&mcy;&ocy;&iecy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&acy;&vcy;&lcy;&icy;&vcy;&acy;&iecy;&tcy;&scy;&yacy; &icy;&zcy;  <code>HEAD</code> , &iecy;&scy;&lcy;&icy; &ucy;&kcy;&acy;&zcy;&acy;&ncy;  <code>--staged</code> , &vcy; &pcy;&rcy;&ocy;&tcy;&icy;&vcy;&ncy;&ocy;&mcy; &scy;&lcy;&ucy;&chcy;&acy;&iecy; &mdash; &icy;&zcy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&acy;.</span></p> <p><span data-i18n="b7ea723c336e6e66cc1fa15cbdec77d3c2647ab7be211e57f4cccfbedf18042f/9b" data-source="As a special case, you may use &lt;code&gt;&amp;quot;A...B&amp;quot;&lt;/code&gt; as a shortcut for the merge base of &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt; if there is exactly one merge base. You can leave out at most one of &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt;, in which case it defaults to &lt;code&gt;HEAD&lt;/code&gt;." onmousemove="i18n(this)">&Vcy; &chcy;&acy;&scy;&tcy;&ncy;&ocy;&mcy; &scy;&lcy;&ucy;&chcy;&acy;&iecy; &vcy;&ycy; &mcy;&ocy;&zhcy;&iecy;&tcy;&iecy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&tcy;&softcy;  <code>&quot;A...B&quot;</code>  &vcy; &kcy;&acy;&chcy;&iecy;&scy;&tcy;&vcy;&iecy; &yacy;&rcy;&lcy;&ycy;&kcy;&acy; &dcy;&lcy;&yacy; &bcy;&acy;&zcy;&ycy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&yacy;  <code>A</code>  &icy;  <code>B</code> , &iecy;&scy;&lcy;&icy; &scy;&ucy;&shchcy;&iecy;&scy;&tcy;&vcy;&ucy;&iecy;&tcy; &rcy;&ocy;&vcy;&ncy;&ocy; &ocy;&dcy;&ncy;&acy; &bcy;&acy;&zcy;&acy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&yacy;. &Vcy;&ycy; &mcy;&ocy;&zhcy;&iecy;&tcy;&iecy; &icy;&scy;&kcy;&lcy;&yucy;&chcy;&icy;&tcy;&softcy; &ncy;&iecy; &bcy;&ocy;&lcy;&iecy;&iecy; &ocy;&dcy;&ncy;&ocy;&gcy;&ocy; &icy;&zcy;  <code>A</code>  &icy;  <code>B</code> , &vcy; &ecy;&tcy;&ocy;&mcy; &scy;&lcy;&ucy;&chcy;&acy;&iecy; &pcy;&ocy; &ucy;&mcy;&ocy;&lcy;&chcy;&acy;&ncy;&icy;&yucy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ucy;&iecy;&tcy;&scy;&yacy;  <code>HEAD</code> .</span></p> </dd> <dt id="Documentation/git-restore.txt--p"><span data-i18n="567479c447e472328522a1d759aabb9b579e4522a6da547c983d29e94c1604c2/a3" data-source="-p" onmousemove="i18n(this)">-p</span></dt> <dt id="Documentation/git-restore.txt---patch"><span data-i18n="7bbfb9636bd1ed3b4d0a3db1cafae5a073c8b069ffda4dcb6cbe8b2a921024c5/4f" data-source="--patch" onmousemove="i18n(this)">--patch</span></dt> <dd> <p><span data-i18n="39062cbc39d09feb333a53230182f0cef01c179489351916cfbab69399a8a9d7/fe" data-source="Interactively select hunks in the difference between the restore source and the restore location. See the &amp;ldquo;Interactive Mode&amp;rdquo; section of &lt;a href=&quot;git-add&quot;&gt;git-add[1]&lt;/a&gt; to learn how to operate the &lt;code&gt;--patch&lt;/code&gt; mode." onmousemove="i18n(this)">&Icy;&ncy;&tcy;&iecy;&rcy;&acy;&kcy;&tcy;&icy;&vcy;&ncy;&ocy; &vcy;&ycy;&bcy;&icy;&rcy;&acy;&jcy;&tcy;&iecy; &ucy;&chcy;&acy;&scy;&tcy;&kcy;&icy; &vcy; &rcy;&acy;&zcy;&ncy;&icy;&tscy;&iecy; &mcy;&iecy;&zhcy;&dcy;&ucy; &icy;&scy;&tcy;&ocy;&chcy;&ncy;&icy;&kcy;&ocy;&mcy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;&icy;&yacy; &icy; &mcy;&iecy;&scy;&tcy;&ocy;&mcy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;&icy;&yacy;. &Scy;&mcy;. &rcy;&acy;&zcy;&dcy;&iecy;&lcy; &laquo;&Icy;&ncy;&tcy;&iecy;&rcy;&acy;&kcy;&tcy;&icy;&vcy;&ncy;&ycy;&jcy; &rcy;&iecy;&zhcy;&icy;&mcy;&raquo;  <a href="git-add.html">git-add[1]</a> , &chcy;&tcy;&ocy;&bcy;&ycy; &ucy;&zcy;&ncy;&acy;&tcy;&softcy;, &kcy;&acy;&kcy; &rcy;&acy;&bcy;&ocy;&tcy;&acy;&tcy;&softcy; &vcy; &rcy;&iecy;&zhcy;&icy;&mcy;&iecy;  <code>--patch</code> .</span></p> <p><span data-i18n="e1897e67f714d066a0804d67cc11b62fa598b223038a95ed63464c71a7108cd5/3e" data-source="Note that &lt;code&gt;--patch&lt;/code&gt; can accept no pathspec and will prompt to restore all modified paths." onmousemove="i18n(this)">&Ocy;&bcy;&rcy;&acy;&tcy;&icy;&tcy;&iecy; &vcy;&ncy;&icy;&mcy;&acy;&ncy;&icy;&iecy;, &chcy;&tcy;&ocy;  <code>--patch</code>  &ncy;&iecy; &mcy;&ocy;&zhcy;&iecy;&tcy; &pcy;&rcy;&icy;&ncy;&yacy;&tcy;&softcy; &scy;&pcy;&iecy;&tscy;&icy;&fcy;&icy;&kcy;&acy;&tscy;&icy;&yucy; &pcy;&ucy;&tcy;&icy; &icy; &pcy;&rcy;&iecy;&dcy;&lcy;&ocy;&zhcy;&icy;&tcy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&icy;&tcy;&softcy; &vcy;&scy;&iecy; &icy;&zcy;&mcy;&iecy;&ncy;&iecy;&ncy;&ncy;&ycy;&iecy; &pcy;&ucy;&tcy;&icy;.</span></p> </dd> <dt id="Documentation/git-restore.txt--W"><span data-i18n="5671c9b05916ba4c093a158dd36b2d9f703ad98b4a2ebef4a0864014d3839060/df" data-source="-W" onmousemove="i18n(this)">-W</span></dt> <dt id="Documentation/git-restore.txt---worktree"><span data-i18n="a6ea450621a0d453aa297c437254a3be27e7add00593d44b01766508dbb5400a/20" data-source="--worktree" onmousemove="i18n(this)">--worktree</span></dt> <dt id="Documentation/git-restore.txt--S"><span data-i18n="eab6b8b065131cab9718da4fc7c26d8f7c9e7c1e327a603e6f37aef921750a3d/e6" data-source="-S" onmousemove="i18n(this)">-S</span></dt> <dt id="Documentation/git-restore.txt---staged"><span data-i18n="f7bda2e98d98313ac738d6479b4703a5b4a4da0a13913468e6450b50c8c97cad/4a" data-source="--staged" onmousemove="i18n(this)">--staged</span></dt> <dd> <p><span data-i18n="fc33097b0305f3c6c3019ebbd471e83ebd32d257be8c273db9ee7c75d27de585/08" data-source="Specify the restore location. If neither option is specified, by default the working tree is restored. Specifying &lt;code&gt;--staged&lt;/code&gt; will only restore the index. Specifying both restores both." onmousemove="i18n(this)">&Ucy;&kcy;&acy;&zhcy;&icy;&tcy;&iecy; &mcy;&iecy;&scy;&tcy;&ocy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;&icy;&yacy;. &IEcy;&scy;&lcy;&icy; &ncy;&icy; &ocy;&dcy;&icy;&ncy; &icy;&zcy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy;&ocy;&vcy; &ncy;&iecy; &ucy;&kcy;&acy;&zcy;&acy;&ncy;, &pcy;&ocy; &ucy;&mcy;&ocy;&lcy;&chcy;&acy;&ncy;&icy;&yucy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&acy;&vcy;&lcy;&icy;&vcy;&acy;&iecy;&tcy;&scy;&yacy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&iecy; &dcy;&iecy;&rcy;&iecy;&vcy;&ocy;. &Ucy;&kcy;&acy;&zcy;&acy;&ncy;&icy;&iecy;  <code>--staged</code>  &pcy;&rcy;&icy;&vcy;&iecy;&dcy;&iecy;&tcy; &tcy;&ocy;&lcy;&softcy;&kcy;&ocy; &kcy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;&icy;&yucy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&acy;. &Ucy;&kcy;&acy;&zcy;&acy;&ncy;&icy;&iecy; &ocy;&bcy;&ocy;&icy;&khcy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&acy;&vcy;&lcy;&icy;&vcy;&acy;&iecy;&tcy; &ocy;&bcy;&acy;.</span></p> </dd> <dt id="Documentation/git-restore.txt--q"><span data-i18n="5ce681666a15a41274346f65b8bcbf56f8e8170ac00706a44a09ee4d786a8609/cd" data-source="-q" onmousemove="i18n(this)">-q</span></dt> <dt id="Documentation/git-restore.txt---quiet"><span data-i18n="b00818cdc507640687732769ee1cb501db377927ee76d03df23978bd0d706888/e2" data-source="--quiet" onmousemove="i18n(this)">--quiet</span></dt> <dd> <p><span data-i18n="f0fca5b2b2b1be06f1984bf54022d3f97242965e27c9a55fb6d0f7b265d3d072/2d" data-source="Quiet, suppress feedback messages. Implies &lt;code&gt;--no-progress&lt;/code&gt;." onmousemove="i18n(this)">&Tcy;&icy;&khcy;&ocy;, &pcy;&ocy;&dcy;&acy;&vcy;&lcy;&yacy;&jcy;&tcy;&iecy; &scy;&ocy;&ocy;&bcy;&shchcy;&iecy;&ncy;&icy;&yacy; &ocy;&bcy;&rcy;&acy;&tcy;&ncy;&ocy;&jcy; &scy;&vcy;&yacy;&zcy;&icy;. &Pcy;&ocy;&dcy;&rcy;&acy;&zcy;&ucy;&mcy;&iecy;&vcy;&acy;&iecy;&tcy;&scy;&yacy;  <code>--no-progress</code> .</span></p> </dd> <dt id="Documentation/git-restore.txt---progress"><span data-i18n="c4d85ead394fc39f65f473a99058ad8fe951b5cd8d8dacc9e82d90e36b6430ea/a2" data-source="--progress" onmousemove="i18n(this)">--progress</span></dt> <dt id="Documentation/git-restore.txt---no-progress"><span data-i18n="22f4f0ddc705adf0de87e662c11a1d9f91a5693bfd2b50df9fec2f4ba289b775/63" data-source="--no-progress" onmousemove="i18n(this)">--no-progress</span></dt> <dd> <p><span data-i18n="e45586208d5dd0110c830f166300dfa135cf6e1c4f71bb6b0064b377806a1b49/29" data-source="Progress status is reported on the standard error stream by default when it is attached to a terminal, unless &lt;code&gt;--quiet&lt;/code&gt; is specified. This flag enables progress reporting even if not attached to a terminal, regardless of &lt;code&gt;--quiet&lt;/code&gt;." onmousemove="i18n(this)">&Scy;&tcy;&acy;&tcy;&ucy;&scy; &vcy;&ycy;&pcy;&ocy;&lcy;&ncy;&iecy;&ncy;&icy;&yacy; &pcy;&ocy; &ucy;&mcy;&ocy;&lcy;&chcy;&acy;&ncy;&icy;&yucy; &scy;&ocy;&ocy;&bcy;&shchcy;&acy;&iecy;&tcy;&scy;&yacy; &vcy; &scy;&tcy;&acy;&ncy;&dcy;&acy;&rcy;&tcy;&ncy;&ocy;&mcy; &pcy;&ocy;&tcy;&ocy;&kcy;&iecy; &ocy;&shcy;&icy;&bcy;&ocy;&kcy;, &kcy;&ocy;&gcy;&dcy;&acy; &ocy;&ncy; &pcy;&ocy;&dcy;&kcy;&lcy;&yucy;&chcy;&iecy;&ncy; &kcy; &tcy;&iecy;&rcy;&mcy;&icy;&ncy;&acy;&lcy;&ucy;, &iecy;&scy;&lcy;&icy; &ncy;&iecy; &ucy;&kcy;&acy;&zcy;&acy;&ncy;  <code>--quiet</code> . &Ecy;&tcy;&ocy;&tcy; &fcy;&lcy;&acy;&gcy; &vcy;&kcy;&lcy;&yucy;&chcy;&acy;&iecy;&tcy; &ocy;&tcy;&chcy;&iecy;&tcy; &ocy; &khcy;&ocy;&dcy;&iecy; &vcy;&ycy;&pcy;&ocy;&lcy;&ncy;&iecy;&ncy;&icy;&yacy;, &dcy;&acy;&zhcy;&iecy; &iecy;&scy;&lcy;&icy; &ocy;&ncy; &ncy;&iecy; &pcy;&ocy;&dcy;&kcy;&lcy;&yucy;&chcy;&iecy;&ncy; &kcy; &tcy;&iecy;&rcy;&mcy;&icy;&ncy;&acy;&lcy;&ucy;, &ncy;&iecy;&zcy;&acy;&vcy;&icy;&scy;&icy;&mcy;&ocy; &ocy;&tcy;  <code>--quiet</code> .</span></p> </dd> <dt id="Documentation/git-restore.txt---ours"><span data-i18n="f095625b4b5843255d2d62746f988ab17ba239db35dcc805e381f9c06c485e02/ec" data-source="--ours" onmousemove="i18n(this)">--ours</span></dt> <dt id="Documentation/git-restore.txt---theirs"><span data-i18n="40c0d0b85d63db14b31ceecbc1352ef98653b2455a324cec67a63f45b0dd8396/e4" data-source="--theirs" onmousemove="i18n(this)">--theirs</span></dt> <dd> <p><span data-i18n="8c0667ab355919e8aa3f3912803f25f376e25e41c3f44fc596dfb8b89e9cb193/c3" data-source="When restoring files in the working tree from the index, use stage #2 (&lt;code&gt;ours&lt;/code&gt;) or #3 (&lt;code&gt;theirs&lt;/code&gt;) for unmerged paths. This option cannot be used when checking out paths from a tree-ish (i.e. with the &lt;code&gt;--source&lt;/code&gt; option)." onmousemove="i18n(this)">&Pcy;&rcy;&icy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;&icy;&icy; &fcy;&acy;&jcy;&lcy;&ocy;&vcy; &vcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy; &icy;&zcy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&acy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ucy;&jcy;&tcy;&iecy; &ecy;&tcy;&acy;&pcy; &numero;2 ( <code>ours</code> ) &icy;&lcy;&icy; &numero;3 ( <code>theirs</code> ) &dcy;&lcy;&yacy; &ncy;&iecy;&scy;&vcy;&yacy;&zcy;&acy;&ncy;&ncy;&ycy;&khcy; &pcy;&ucy;&tcy;&iecy;&jcy;. &Ecy;&tcy;&ucy; &ocy;&pcy;&tscy;&icy;&yucy; &ncy;&iecy;&lcy;&softcy;&zcy;&yacy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&tcy;&softcy; &pcy;&rcy;&icy; &pcy;&rcy;&ocy;&vcy;&iecy;&rcy;&kcy;&iecy; &pcy;&ucy;&tcy;&iecy;&jcy; &icy;&zcy; &dcy;&iecy;&rcy;&iecy;&vcy;&acy; (&tcy;. &iecy;. &scy; &ocy;&pcy;&tscy;&icy;&iecy;&jcy;  <code>--source</code> ).</span></p> <p><span data-i18n="29a6e5bcd6c37cbb1d6b2a21d7594c4c6806fa94c6e98dc4434e0220475c3dff/49" data-source="Note that during &lt;code&gt;git rebase&lt;/code&gt; and &lt;code&gt;git pull --rebase&lt;/code&gt;, &lt;code&gt;ours&lt;/code&gt; and &lt;code&gt;theirs&lt;/code&gt; may appear swapped. See the explanation of the same options in &lt;a href=&quot;git-checkout&quot;&gt;git-checkout[1]&lt;/a&gt; for details." onmousemove="i18n(this)">&Ocy;&bcy;&rcy;&acy;&tcy;&icy;&tcy;&iecy; &vcy;&ncy;&icy;&mcy;&acy;&ncy;&icy;&iecy;, &chcy;&tcy;&ocy; &vcy;&ocy; &vcy;&rcy;&iecy;&mcy;&yacy;  <code>git rebase</code>  &icy;  <code>git pull --rebase</code> <code>ours</code>  &icy;  <code>theirs</code>  &mcy;&ocy;&gcy;&ucy;&tcy; &ocy;&tcy;&ocy;&bcy;&rcy;&acy;&zhcy;&acy;&tcy;&softcy;&scy;&yacy; &pcy;&iecy;&rcy;&iecy;&pcy;&ucy;&tcy;&acy;&ncy;&ncy;&ycy;&mcy;&icy;. &Pcy;&ocy;&dcy;&rcy;&ocy;&bcy;&ncy;&ocy;&scy;&tcy;&icy; &scy;&mcy;. &vcy; &ocy;&pcy;&icy;&scy;&acy;&ncy;&icy;&icy; &tcy;&iecy;&khcy; &zhcy;&iecy; &ocy;&pcy;&tscy;&icy;&jcy; &vcy;  <a href="git-checkout.html">git-checkout[1]</a> .</span></p> </dd> <dt id="Documentation/git-restore.txt--m"><span data-i18n="c4e153afb4aeaa5818fb08325ebff59f883a0482006aa3cc1c17c9b393e54efa/11" data-source="-m" onmousemove="i18n(this)">-m</span></dt> <dt id="Documentation/git-restore.txt---merge"><span data-i18n="8fb0e06813ad30153047701775d50b3c457f0df427ea7a690312a21a2e94ea2d/e9" data-source="--merge" onmousemove="i18n(this)">--merge</span></dt> <dd> <p><span data-i18n="e392d5389977fb2ef11a5681305752e26098970a05ea1a73265985448e9fe501/a1" data-source="When restoring files on the working tree from the index, recreate the conflicted merge in the unmerged paths. This option cannot be used when checking out paths from a tree-ish (i.e. with the &lt;code&gt;--source&lt;/code&gt; option)." onmousemove="i18n(this)">&Pcy;&rcy;&icy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;&icy;&icy; &fcy;&acy;&jcy;&lcy;&ocy;&vcy; &vcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy; &icy;&zcy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&acy; &vcy;&ocy;&scy;&scy;&ocy;&zcy;&dcy;&acy;&jcy;&tcy;&iecy; &kcy;&ocy;&ncy;&fcy;&lcy;&icy;&kcy;&tcy;&ncy;&ocy;&iecy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&iecy; &vcy; &ncy;&iecy;&scy;&vcy;&yacy;&zcy;&acy;&ncy;&ncy;&ycy;&khcy; &pcy;&ucy;&tcy;&yacy;&khcy;. &Ecy;&tcy;&ucy; &ocy;&pcy;&tscy;&icy;&yucy; &ncy;&iecy;&lcy;&softcy;&zcy;&yacy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&tcy;&softcy; &pcy;&rcy;&icy; &pcy;&rcy;&ocy;&vcy;&iecy;&rcy;&kcy;&iecy; &pcy;&ucy;&tcy;&iecy;&jcy; &icy;&zcy; &dcy;&iecy;&rcy;&iecy;&vcy;&acy; (&tcy;. &iecy;. &scy; &ocy;&pcy;&tscy;&icy;&iecy;&jcy;  <code>--source</code> ).</span></p> </dd> <dt id="Documentation/git-restore.txt---conflictltstylegt"><span data-i18n="522ba95fd12b03c4081b08801471a2fb60e94274c716618989f36c5712e120bb/75" data-source="--conflict=&amp;lt;style&amp;gt;" onmousemove="i18n(this)">--conflict=&lt;style&gt;</span></dt> <dd> <p><span data-i18n="bfb91f04111fbbb56de36a0c77b1835a15e65a00caf1995c2b9ccc44bbd78f27/4b" data-source="The same as &lt;code&gt;--merge&lt;/code&gt; option above, but changes the way the conflicting hunks are presented, overriding the &lt;code&gt;merge.conflictStyle&lt;/code&gt; configuration variable. Possible values are &amp;quot;merge&amp;quot; (default), &amp;quot;diff3&amp;quot;, and &amp;quot;zdiff3&amp;quot;." onmousemove="i18n(this)">&Tcy;&ocy; &zhcy;&iecy;, &chcy;&tcy;&ocy; &icy; &ocy;&pcy;&tscy;&icy;&yacy;  <code>--merge</code>  &vcy;&ycy;&shcy;&iecy;, &ncy;&ocy; &mcy;&iecy;&ncy;&yacy;&iecy;&tcy; &scy;&pcy;&ocy;&scy;&ocy;&bcy; &pcy;&rcy;&iecy;&dcy;&scy;&tcy;&acy;&vcy;&lcy;&iecy;&ncy;&icy;&yacy; &kcy;&ocy;&ncy;&fcy;&lcy;&icy;&kcy;&tcy;&ucy;&yucy;&shchcy;&icy;&khcy; &fcy;&rcy;&acy;&gcy;&mcy;&iecy;&ncy;&tcy;&ocy;&vcy;, &pcy;&iecy;&rcy;&iecy;&ocy;&pcy;&rcy;&iecy;&dcy;&iecy;&lcy;&yacy;&yacy; &pcy;&iecy;&rcy;&iecy;&mcy;&iecy;&ncy;&ncy;&ucy;&yucy; &kcy;&ocy;&ncy;&fcy;&icy;&gcy;&ucy;&rcy;&acy;&tscy;&icy;&icy;  <code>merge.conflictStyle</code> . &Vcy;&ocy;&zcy;&mcy;&ocy;&zhcy;&ncy;&ycy;&iecy; &zcy;&ncy;&acy;&chcy;&iecy;&ncy;&icy;&yacy;:  &quot;merge&quot;  (&pcy;&ocy; &ucy;&mcy;&ocy;&lcy;&chcy;&acy;&ncy;&icy;&yucy;),  &quot;diff3&quot;  &icy;  &quot;zdiff3&quot; .</span></p> </dd> <dt id="Documentation/git-restore.txt---ignore-unmerged"><span data-i18n="1122260f98504f12f347fe5c99d034fbc5d164540df650aa1ce7ed8879240434/cf" data-source="--ignore-unmerged" onmousemove="i18n(this)">--ignore-unmerged</span></dt> <dd> <p><span data-i18n="00999a721226c8fc7b9157278097a093a17306b9d228debaeaa121f9c6816562/9e" data-source="When restoring files on the working tree from the index, do not abort the operation if there are unmerged entries and neither &lt;code&gt;--ours&lt;/code&gt;, &lt;code&gt;--theirs&lt;/code&gt;, &lt;code&gt;--merge&lt;/code&gt; or &lt;code&gt;--conflict&lt;/code&gt; is specified. Unmerged paths on the working tree are left alone." onmousemove="i18n(this)">&Pcy;&rcy;&icy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;&icy;&icy; &fcy;&acy;&jcy;&lcy;&ocy;&vcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&gcy;&ocy; &dcy;&iecy;&rcy;&iecy;&vcy;&acy; &icy;&zcy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&acy; &ncy;&iecy; &pcy;&rcy;&iecy;&rcy;&ycy;&vcy;&acy;&jcy;&tcy;&iecy; &ocy;&pcy;&iecy;&rcy;&acy;&tscy;&icy;&yucy;, &iecy;&scy;&lcy;&icy; &iecy;&scy;&tcy;&softcy; &ncy;&iecy;&scy;&vcy;&yacy;&zcy;&acy;&ncy;&ncy;&ycy;&iecy; &zcy;&acy;&pcy;&icy;&scy;&icy; &icy; &ncy;&iecy; &ucy;&kcy;&acy;&zcy;&acy;&ncy;&ycy;  <code>--ours</code> ,  <code>--theirs</code> ,  <code>--merge</code>  &icy;&lcy;&icy;  <code>--conflict</code> . &Ncy;&iecy;&ocy;&bcy;&hardcy;&iecy;&dcy;&icy;&ncy;&iecy;&ncy;&ncy;&ycy;&iecy; &pcy;&ucy;&tcy;&icy; &vcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy; &ocy;&scy;&tcy;&acy;&yucy;&tcy;&scy;&yacy; &vcy; &pcy;&ocy;&kcy;&ocy;&iecy;.</span></p> </dd> <dt id="Documentation/git-restore.txt---ignore-skip-worktree-bits"><span data-i18n="ccef600f0052473096f7dbcd41f7e624748accd9277f4b76bc32559d64994248/c3" data-source="--ignore-skip-worktree-bits" onmousemove="i18n(this)">--ignore-skip-worktree-bits</span></dt> <dd> <p><span data-i18n="10d4beae63bbdc4170f3e9a0fe61cd393ee01df03beb2e304ccc61f0d0ba0ceb/17" data-source="In sparse checkout mode, the default is to only update entries matched by &lt;code&gt;&amp;lt;pathspec&amp;gt;&lt;/code&gt; and sparse patterns in $GIT_DIR/info/sparse-checkout. This option ignores the sparse patterns and unconditionally restores any files in &lt;code&gt;&amp;lt;pathspec&amp;gt;&lt;/code&gt;." onmousemove="i18n(this)">&Vcy; &rcy;&iecy;&zhcy;&icy;&mcy;&iecy; &rcy;&acy;&zcy;&rcy;&iecy;&zhcy;&iecy;&ncy;&ncy;&ocy;&jcy; &pcy;&rcy;&ocy;&vcy;&iecy;&rcy;&kcy;&icy; &pcy;&ocy; &ucy;&mcy;&ocy;&lcy;&chcy;&acy;&ncy;&icy;&yucy; &ocy;&bcy;&ncy;&ocy;&vcy;&lcy;&yacy;&yucy;&tcy;&scy;&yacy; &tcy;&ocy;&lcy;&softcy;&kcy;&ocy; &zcy;&acy;&pcy;&icy;&scy;&icy;, &scy;&ocy;&ocy;&tcy;&vcy;&iecy;&tcy;&scy;&tcy;&vcy;&ucy;&yucy;&shchcy;&icy;&iecy;  <code>&lt;pathspec&gt;</code> , &icy; &rcy;&acy;&zcy;&rcy;&iecy;&zhcy;&iecy;&ncy;&ncy;&ycy;&iecy; &shcy;&acy;&bcy;&lcy;&ocy;&ncy;&ycy; &vcy; $GIT_DIR/info/sparse-checkout. &Ecy;&tcy;&acy; &ocy;&pcy;&tscy;&icy;&yacy; &icy;&gcy;&ncy;&ocy;&rcy;&icy;&rcy;&ucy;&iecy;&tcy; &rcy;&acy;&zcy;&rcy;&iecy;&zhcy;&iecy;&ncy;&ncy;&ycy;&iecy; &shcy;&acy;&bcy;&lcy;&ocy;&ncy;&ycy; &icy; &bcy;&iecy;&zcy;&ocy;&gcy;&ocy;&vcy;&ocy;&rcy;&ocy;&chcy;&ncy;&ocy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&acy;&vcy;&lcy;&icy;&vcy;&acy;&iecy;&tcy; &lcy;&yucy;&bcy;&ycy;&iecy; &fcy;&acy;&jcy;&lcy;&ycy; &vcy;  <code>&lt;pathspec&gt;</code> .</span></p> </dd> <dt id="Documentation/git-restore.txt---recurse-submodules"><span data-i18n="2231f8979cc1799feb27527355da56bc90932af42030d2159c151d968a21c515/a1" data-source="--recurse-submodules" onmousemove="i18n(this)">--recurse-submodules</span></dt> <dt id="Documentation/git-restore.txt---no-recurse-submodules"><span data-i18n="ee4f361b3708c726b2f1293d566df473542bac3b43b3608403ec7478dd8ce95f/00" data-source="--no-recurse-submodules" onmousemove="i18n(this)">--no-recurse-submodules</span></dt> <dd> <p><span data-i18n="10bf1350885e1d5817102237babd22ff88dae367429764ecd0dd5589c578f15d/cb" data-source="If &lt;code&gt;&amp;lt;pathspec&amp;gt;&lt;/code&gt; names an active submodule and the restore location includes the working tree, the submodule will only be updated if this option is given, in which case its working tree will be restored to the commit recorded in the superproject, and any local modifications overwritten. If nothing (or &lt;code&gt;--no-recurse-submodules&lt;/code&gt;) is used, submodules working trees will not be updated. Just like &lt;a href=&quot;git-checkout&quot;&gt;git-checkout[1]&lt;/a&gt;, this will detach &lt;code&gt;HEAD&lt;/code&gt; of the submodule." onmousemove="i18n(this)">&IEcy;&scy;&lcy;&icy;  <code>&lt;pathspec&gt;</code>  &ncy;&acy;&zcy;&ycy;&vcy;&acy;&iecy;&tcy; &acy;&kcy;&tcy;&icy;&vcy;&ncy;&ycy;&jcy; &pcy;&ocy;&dcy;&mcy;&ocy;&dcy;&ucy;&lcy;&softcy; &icy; &mcy;&iecy;&scy;&tcy;&ocy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;&icy;&yacy; &vcy;&kcy;&lcy;&yucy;&chcy;&acy;&iecy;&tcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&iecy; &dcy;&iecy;&rcy;&iecy;&vcy;&ocy;, &pcy;&ocy;&dcy;&mcy;&ocy;&dcy;&ucy;&lcy;&softcy; &bcy;&ucy;&dcy;&iecy;&tcy; &ocy;&bcy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy; &tcy;&ocy;&lcy;&softcy;&kcy;&ocy; &vcy; &tcy;&ocy;&mcy; &scy;&lcy;&ucy;&chcy;&acy;&iecy;, &iecy;&scy;&lcy;&icy; &ucy;&kcy;&acy;&zcy;&acy;&ncy;&acy; &ecy;&tcy;&acy; &ocy;&pcy;&tscy;&icy;&yacy;, &icy; &vcy; &ecy;&tcy;&ocy;&mcy; &scy;&lcy;&ucy;&chcy;&acy;&iecy; &iecy;&gcy;&ocy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&iecy; &dcy;&iecy;&rcy;&iecy;&vcy;&ocy; &bcy;&ucy;&dcy;&iecy;&tcy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;&ocy; &dcy;&ocy; &fcy;&icy;&kcy;&scy;&acy;&tscy;&icy;&icy;, &zcy;&acy;&pcy;&icy;&scy;&acy;&ncy;&ncy;&ocy;&jcy; &vcy; &scy;&ucy;&pcy;&iecy;&rcy;&pcy;&rcy;&ocy;&iecy;&kcy;&tcy;&iecy;, &acy; &lcy;&yucy;&bcy;&ycy;&iecy; &lcy;&ocy;&kcy;&acy;&lcy;&softcy;&ncy;&ycy;&iecy; &icy;&zcy;&mcy;&iecy;&ncy;&iecy;&ncy;&icy;&yacy; &bcy;&ucy;&dcy;&ucy;&tcy; &pcy;&iecy;&rcy;&iecy;&zcy;&acy;&pcy;&icy;&scy;&acy;&ncy;&ycy;. &IEcy;&scy;&lcy;&icy; &ncy;&icy;&chcy;&iecy;&gcy;&ocy; (&icy;&lcy;&icy;  <code>--no-recurse-submodules</code> ) &ncy;&iecy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ucy;&iecy;&tcy;&scy;&yacy;, &rcy;&acy;&bcy;&ocy;&chcy;&icy;&iecy; &dcy;&iecy;&rcy;&iecy;&vcy;&softcy;&yacy; &pcy;&ocy;&dcy;&mcy;&ocy;&dcy;&ucy;&lcy;&iecy;&jcy; &ocy;&bcy;&ncy;&ocy;&vcy;&lcy;&yacy;&tcy;&softcy;&scy;&yacy; &ncy;&iecy; &bcy;&ucy;&dcy;&ucy;&tcy;. &Kcy;&acy;&kcy; &icy; &vcy; &scy;&lcy;&ucy;&chcy;&acy;&iecy; &scy;  <a href="git-checkout.html">git-checkout[1]</a> , &ecy;&tcy;&ocy; &pcy;&rcy;&icy;&vcy;&iecy;&dcy;&iecy;&tcy; &kcy; &ocy;&tcy;&kcy;&lcy;&yucy;&chcy;&iecy;&ncy;&icy;&yucy;  <code>HEAD</code>  &ocy;&tcy; &scy;&ucy;&bcy;&mcy;&ocy;&dcy;&ucy;&lcy;&yacy;.</span></p> </dd> <dt id="Documentation/git-restore.txt---overlay"><span data-i18n="d1b5e61bf4e2c8ee54feb467d946a4318c07a1c502578fb5dd884e87a89a81d1/e3" data-source="--overlay" onmousemove="i18n(this)">--overlay</span></dt> <dt id="Documentation/git-restore.txt---no-overlay"><span data-i18n="92c76ce8c4f0002baff4fade35b7bb975bcaa7d406c4e3ee50cd690629ba4c8e/34" data-source="--no-overlay" onmousemove="i18n(this)">--no-overlay</span></dt> <dd> <p><span data-i18n="f655c2bcd122ef6c9906a88ae2fa67d6e2e5d7f0d50435548218eaf0193d2461/0e" data-source="In overlay mode, the command never removes files when restoring. In no-overlay mode, tracked files that do not appear in the &lt;code&gt;--source&lt;/code&gt; tree are removed, to make them match &lt;code&gt;&amp;lt;tree&amp;gt;&lt;/code&gt; exactly. The default is no-overlay mode." onmousemove="i18n(this)">&Vcy; &rcy;&iecy;&zhcy;&icy;&mcy;&iecy; &ncy;&acy;&lcy;&ocy;&zhcy;&iecy;&ncy;&icy;&yacy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&acy; &ncy;&icy;&kcy;&ocy;&gcy;&dcy;&acy; &ncy;&iecy; &ucy;&dcy;&acy;&lcy;&yacy;&iecy;&tcy; &fcy;&acy;&jcy;&lcy;&ycy; &pcy;&rcy;&icy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;&icy;&icy;. &Vcy; &rcy;&iecy;&zhcy;&icy;&mcy;&iecy; &bcy;&iecy;&zcy; &ncy;&acy;&lcy;&ocy;&zhcy;&iecy;&ncy;&icy;&yacy; &ocy;&tcy;&scy;&lcy;&iecy;&zhcy;&icy;&vcy;&acy;&iecy;&mcy;&ycy;&iecy; &fcy;&acy;&jcy;&lcy;&ycy;, &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&iecy; &ncy;&iecy; &ocy;&tcy;&ocy;&bcy;&rcy;&acy;&zhcy;&acy;&yucy;&tcy;&scy;&yacy; &vcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy;  <code>--source</code> , &ucy;&dcy;&acy;&lcy;&yacy;&yucy;&tcy;&scy;&yacy;, &chcy;&tcy;&ocy;&bcy;&ycy; &ocy;&ncy;&icy; &tcy;&ocy;&chcy;&ncy;&ocy; &scy;&ocy;&ocy;&tcy;&vcy;&iecy;&tcy;&scy;&tcy;&vcy;&ocy;&vcy;&acy;&lcy;&icy;  <code>&lt;tree&gt;</code> . &Pcy;&ocy; &ucy;&mcy;&ocy;&lcy;&chcy;&acy;&ncy;&icy;&yucy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ucy;&iecy;&tcy;&scy;&yacy; &rcy;&iecy;&zhcy;&icy;&mcy; &bcy;&iecy;&zcy; &ncy;&acy;&lcy;&ocy;&zhcy;&iecy;&ncy;&icy;&yacy;.</span></p> </dd> <dt id="Documentation/git-restore.txt---pathspec-from-fileltfilegt"><span data-i18n="da8857eb3d44efb4cdb38781f7cc2d2dd9074dc3c2a6ca51bd424135fedabfd0/18" data-source="--pathspec-from-file=&amp;lt;file&amp;gt;" onmousemove="i18n(this)">--pathspec-from-file=&lt;file&gt;</span></dt> <dd> <p><span data-i18n="edbea5c504ccb9748dfc5d09bca08d1600446d3e324d8503642ae08801e92fce/7b" data-source="Pathspec is passed in &lt;code&gt;&amp;lt;file&amp;gt;&lt;/code&gt; instead of commandline args. If &lt;code&gt;&amp;lt;file&amp;gt;&lt;/code&gt; is exactly &lt;code&gt;-&lt;/code&gt; then standard input is used. Pathspec elements are separated by LF or CR/LF. Pathspec elements can be quoted as explained for the configuration variable &lt;code&gt;core.quotePath&lt;/code&gt; (see &lt;a href=&quot;git-config&quot;&gt;git-config[1]&lt;/a&gt;). See also &lt;code&gt;--pathspec-file-nul&lt;/code&gt; and global &lt;code&gt;--literal-pathspecs&lt;/code&gt;." onmousemove="i18n(this)">&Scy;&pcy;&iecy;&tscy;&icy;&fcy;&icy;&kcy;&acy;&tscy;&icy;&yacy; &pcy;&ucy;&tcy;&icy; &pcy;&iecy;&rcy;&iecy;&dcy;&acy;&iecy;&tcy;&scy;&yacy; &vcy;  <code>&lt;file&gt;</code>  &vcy;&mcy;&iecy;&scy;&tcy;&ocy; &acy;&rcy;&gcy;&ucy;&mcy;&iecy;&ncy;&tcy;&ocy;&vcy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ncy;&ocy;&jcy; &scy;&tcy;&rcy;&ocy;&kcy;&icy;. &IEcy;&scy;&lcy;&icy;  <code>&lt;file&gt;</code>  &mdash; &ecy;&tcy;&ocy; &tcy;&ocy;&chcy;&ncy;&ocy;  <code>-</code> , &tcy;&ocy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ucy;&iecy;&tcy;&scy;&yacy; &scy;&tcy;&acy;&ncy;&dcy;&acy;&rcy;&tcy;&ncy;&ycy;&jcy; &vcy;&vcy;&ocy;&dcy;. &Ecy;&lcy;&iecy;&mcy;&iecy;&ncy;&tcy;&ycy; Pathspec &rcy;&acy;&zcy;&dcy;&iecy;&lcy;&yacy;&yucy;&tcy;&scy;&yacy; LF &icy;&lcy;&icy; CR/LF. &Ecy;&lcy;&iecy;&mcy;&iecy;&ncy;&tcy;&ycy; Pathspec &mcy;&ocy;&zhcy;&ncy;&ocy; &zcy;&acy;&kcy;&lcy;&yucy;&chcy;&acy;&tcy;&softcy; &vcy; &kcy;&acy;&vcy;&ycy;&chcy;&kcy;&icy;, &kcy;&acy;&kcy; &ocy;&pcy;&icy;&scy;&acy;&ncy;&ocy; &dcy;&lcy;&yacy; &pcy;&iecy;&rcy;&iecy;&mcy;&iecy;&ncy;&ncy;&ocy;&jcy; &kcy;&ocy;&ncy;&fcy;&icy;&gcy;&ucy;&rcy;&acy;&tscy;&icy;&icy;  <code>core.quotePath</code>  (&scy;&mcy;.  <a href="git-config.html">git-config[1]</a> ). &Scy;&mcy;. &tcy;&acy;&kcy;&zhcy;&iecy;  <code>--pathspec-file-nul</code>  &icy; &gcy;&lcy;&ocy;&bcy;&acy;&lcy;&softcy;&ncy;&ycy;&jcy;  <code>--literal-pathspecs</code> .</span></p> </dd> <dt id="Documentation/git-restore.txt---pathspec-file-nul"><span data-i18n="425e5942f80034f1f089327693cf66158c953fde8f89bae24b0fbc651b9af0e9/1a" data-source="--pathspec-file-nul" onmousemove="i18n(this)">--pathspec-file-nul</span></dt> <dd> <p><span data-i18n="7e27df84b5773075cf108a34f1dc37f2f6a47f96c09842b70ed9d300ad32e7c1/c3" data-source="Only meaningful with &lt;code&gt;--pathspec-from-file&lt;/code&gt;. Pathspec elements are separated with NUL character and all other characters are taken literally (including newlines and quotes)." onmousemove="i18n(this)">&Icy;&mcy;&iecy;&iecy;&tcy; &scy;&mcy;&ycy;&scy;&lcy; &tcy;&ocy;&lcy;&softcy;&kcy;&ocy; &scy;  <code>--pathspec-from-file</code> . &Ecy;&lcy;&iecy;&mcy;&iecy;&ncy;&tcy;&ycy; Pathspec &rcy;&acy;&zcy;&dcy;&iecy;&lcy;&yacy;&yucy;&tcy;&scy;&yacy; &scy;&icy;&mcy;&vcy;&ocy;&lcy;&ocy;&mcy; NUL, &acy; &vcy;&scy;&iecy; &ocy;&scy;&tcy;&acy;&lcy;&softcy;&ncy;&ycy;&iecy; &scy;&icy;&mcy;&vcy;&ocy;&lcy;&ycy; &vcy;&ocy;&scy;&pcy;&rcy;&icy;&ncy;&icy;&mcy;&acy;&yucy;&tcy;&scy;&yacy; &bcy;&ucy;&kcy;&vcy;&acy;&lcy;&softcy;&ncy;&ocy; (&vcy;&kcy;&lcy;&yucy;&chcy;&acy;&yacy; &scy;&icy;&mcy;&vcy;&ocy;&lcy;&ycy; &ncy;&ocy;&vcy;&ocy;&jcy; &scy;&tcy;&rcy;&ocy;&kcy;&icy; &icy; &kcy;&acy;&vcy;&ycy;&chcy;&kcy;&icy;).</span></p> </dd> <dt id="Documentation/git-restore.txt---"><span data-i18n="d8156bae0c4243d3742fc4e9774d8aceabe0410249d720c855f98afc88ff846c/71" data-source="--" onmousemove="i18n(this)">--</span></dt> <dd> <p><span data-i18n="0ea53dd4a1fb9384edae11ed9c03b5411457806a0ae358d444eb80e48fbc0c0c/07" data-source="Do not interpret any more arguments as options." onmousemove="i18n(this)">&Ncy;&iecy; &icy;&ncy;&tcy;&iecy;&rcy;&pcy;&rcy;&iecy;&tcy;&icy;&rcy;&ucy;&jcy;&tcy;&iecy; &dcy;&ocy;&pcy;&ocy;&lcy;&ncy;&icy;&tcy;&iecy;&lcy;&softcy;&ncy;&ycy;&iecy; &acy;&rcy;&gcy;&ucy;&mcy;&iecy;&ncy;&tcy;&ycy; &kcy;&acy;&kcy; &vcy;&acy;&rcy;&icy;&acy;&ncy;&tcy;&ycy;.</span></p> </dd> <dt id="Documentation/git-restore.txt-ltpathspecgt82308203"><span data-i18n="5c5493d0791d7f222f3401382dbca513ccb6d257ea0ecc4d926b47bd7c332f5f/89" data-source="&amp;lt;pathspec&amp;gt;&amp;hellip;" onmousemove="i18n(this)">&lt;pathspec&gt;&hellip;</span></dt> <dd> <p><span data-i18n="b65e71126afbf536240ddd20bc10384980e807f79d166373fdf224161b686b4e/b6" data-source="Limits the paths affected by the operation." onmousemove="i18n(this)">&Ocy;&gcy;&rcy;&acy;&ncy;&icy;&chcy;&icy;&vcy;&acy;&iecy;&tcy; &pcy;&ucy;&tcy;&icy;, &ncy;&acy; &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&iecy; &vcy;&lcy;&icy;&yacy;&iecy;&tcy; &ocy;&pcy;&iecy;&rcy;&acy;&tscy;&icy;&yacy;.</span></p> <p><span data-i18n="650607ea17f595aebbbfe78f73f3a97d6140cbf9f4b2d78e76db3388abadf879/ee" data-source="For more details, see the &lt;code&gt;pathspec&lt;/code&gt; entry in &lt;a href=&quot;gitglossary&quot;&gt;gitglossary[7]&lt;/a&gt;." onmousemove="i18n(this)">&Dcy;&ocy;&pcy;&ocy;&lcy;&ncy;&icy;&tcy;&iecy;&lcy;&softcy;&ncy;&ycy;&iecy; &scy;&vcy;&iecy;&dcy;&iecy;&ncy;&icy;&yacy; &scy;&mcy;. &vcy; &zcy;&acy;&pcy;&icy;&scy;&icy;  <code>pathspec</code>  &vcy;  <a href="gitglossary.html">gitglossary[7]</a> .</span></p> </dd> </dl> </div> </div> <h2 class="text-body-emphasis"  id="_examples"><span data-i18n="e68ee04dff59551b7d1ae07a2f8a00dc61d841628948da3d2781630706a05e92/38" data-source="Examples" onmousemove="i18n(this)">Examples</span></h2> <div> <p><span data-i18n="aec594cadb6a42452cf66355541dcf59657c76ef65af405fd77b03defe210674/49" data-source="The following sequence switches to the &lt;code&gt;master&lt;/code&gt; branch, reverts the &lt;code&gt;Makefile&lt;/code&gt; to two revisions back, deletes hello.c by mistake, and gets it back from the index." onmousemove="i18n(this)">&Scy;&lcy;&iecy;&dcy;&ucy;&yucy;&shchcy;&acy;&yacy; &pcy;&ocy;&scy;&lcy;&iecy;&dcy;&ocy;&vcy;&acy;&tcy;&iecy;&lcy;&softcy;&ncy;&ocy;&scy;&tcy;&softcy; &pcy;&iecy;&rcy;&iecy;&kcy;&lcy;&yucy;&chcy;&acy;&iecy;&tcy;&scy;&yacy; &ncy;&acy; &vcy;&iecy;&tcy;&kcy;&ucy;  <code>master</code> , &vcy;&ocy;&zcy;&vcy;&rcy;&acy;&shchcy;&acy;&iecy;&tcy;  <code>Makefile</code>  &ncy;&acy; &dcy;&vcy;&iecy; &rcy;&iecy;&vcy;&icy;&zcy;&icy;&icy; &ncy;&acy;&zcy;&acy;&dcy;, &pcy;&ocy; &ocy;&shcy;&icy;&bcy;&kcy;&iecy; &ucy;&dcy;&acy;&lcy;&yacy;&iecy;&tcy; hello.c &icy; &vcy;&ocy;&zcy;&vcy;&rcy;&acy;&shchcy;&acy;&iecy;&tcy; &iecy;&gcy;&ocy; &icy;&zcy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&acy;.</span></p> <div> <div> <pre class="hljs language-shell"><span class="hljs-meta prompt_">$ </span><span class="language-bash">git switch master</span>
<span class="hljs-meta prompt_">$ </span><span class="language-bash">git restore --<span class="hljs-built_in">source</span> master~2 Makefile  (1)</span>
<span class="hljs-meta prompt_">$ </span><span class="language-bash"><span class="hljs-built_in">rm</span> -f hello.c</span>
<span class="hljs-meta prompt_">$ </span><span class="language-bash">git restore hello.c                     (2)</span></pre> </div> </div> <div> <ol> <li> <p><span data-i18n="05c954b5582a901492344199005d0cbba80d7cc4db0c3b3b51465d9e94a326a1/0a" data-source="take a file out of another commit" onmousemove="i18n(this)">&vcy;&zcy;&yacy;&tcy;&softcy; &fcy;&acy;&jcy;&lcy; &icy;&zcy; &dcy;&rcy;&ucy;&gcy;&ocy;&gcy;&ocy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&acy;</span></p> </li> <li> <p><span data-i18n="310b47b1ab21225532518b27399604a9514820d4a8a5e3181569dba463f16732/5a" data-source="restore hello.c from the index" onmousemove="i18n(this)">&vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&icy;&tcy;&softcy; hello.c &icy;&zcy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&acy;</span></p> </li> </ol> </div> <p><span data-i18n="05f1d3673e4230bd98f28e551a3ae2038e3e84251b3407aa4b587ca3a8149792/6d" data-source="If you want to restore &lt;code&gt;all&lt;/code&gt; C source files to match the version in the index, you can say" onmousemove="i18n(this)">&IEcy;&scy;&lcy;&icy; &vcy;&ycy; &khcy;&ocy;&tcy;&icy;&tcy;&iecy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&icy;&tcy;&softcy; &icy;&scy;&khcy;&ocy;&dcy;&ncy;&ycy;&iecy; &fcy;&acy;&jcy;&lcy;&ycy;  <code>all</code>  C, &chcy;&tcy;&ocy;&bcy;&ycy; &ocy;&ncy;&icy; &scy;&ocy;&ocy;&tcy;&vcy;&iecy;&tcy;&scy;&tcy;&vcy;&ocy;&vcy;&acy;&lcy;&icy; &vcy;&iecy;&rcy;&scy;&icy;&icy; &vcy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&iecy;, &vcy;&ycy; &mcy;&ocy;&zhcy;&iecy;&tcy;&iecy; &scy;&kcy;&acy;&zcy;&acy;&tcy;&softcy;</span></p> <div> <div> <pre class="hljs language-ruby"><span class="hljs-variable">$ </span>git restore <span class="hljs-string">&apos;*.c&apos;</span></pre> </div> </div> <p><span data-i18n="dd520019cce7d7113837006a5f2445cd787da8a82026709ab661178df4684c1a/2c" data-source="Note the quotes around &lt;code&gt;*.c&lt;/code&gt;. The file &lt;code&gt;hello.c&lt;/code&gt; will also be restored, even though it is no longer in the working tree, because the file globbing is used to match entries in the index (not in the working tree by the shell)." onmousemove="i18n(this)">&Ocy;&bcy;&rcy;&acy;&tcy;&icy;&tcy;&iecy; &vcy;&ncy;&icy;&mcy;&acy;&ncy;&icy;&iecy; &ncy;&acy; &kcy;&acy;&vcy;&ycy;&chcy;&kcy;&icy; &vcy;&ocy;&kcy;&rcy;&ucy;&gcy;  <code>*.c</code> . &Fcy;&acy;&jcy;&lcy;  <code>hello.c</code>  &tcy;&acy;&kcy;&zhcy;&iecy; &bcy;&ucy;&dcy;&iecy;&tcy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;, &khcy;&ocy;&tcy;&yacy; &iecy;&gcy;&ocy; &bcy;&ocy;&lcy;&softcy;&shcy;&iecy; &ncy;&iecy;&tcy; &vcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy;, &pcy;&ocy;&scy;&kcy;&ocy;&lcy;&softcy;&kcy;&ucy; &pcy;&ocy;&dcy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&kcy;&acy; &fcy;&acy;&jcy;&lcy;&ocy;&vcy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ucy;&iecy;&tcy;&scy;&yacy; &dcy;&lcy;&yacy; &scy;&ocy;&pcy;&ocy;&scy;&tcy;&acy;&vcy;&lcy;&iecy;&ncy;&icy;&yacy; &zcy;&acy;&pcy;&icy;&scy;&iecy;&jcy; &vcy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&iecy; (&acy; &ncy;&iecy; &vcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy; &ocy;&bcy;&ocy;&lcy;&ocy;&chcy;&kcy;&icy;).</span></p> <p><span data-i18n="cb3ac891588a0fb750a4b50c25f1869b1b87903e4dfd53f4b2c8ae07d44fc124/66" data-source="To restore all files in the current directory" onmousemove="i18n(this)">&CHcy;&tcy;&ocy;&bcy;&ycy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&icy;&tcy;&softcy; &vcy;&scy;&iecy; &fcy;&acy;&jcy;&lcy;&ycy; &vcy; &tcy;&iecy;&kcy;&ucy;&shchcy;&iecy;&mcy; &kcy;&acy;&tcy;&acy;&lcy;&ocy;&gcy;&iecy;</span></p> <div> <div> <pre class="hljs language-ruby"><span class="hljs-variable">$ </span>git restore .</pre> </div> </div> <p><span data-i18n="47ae2c11f32d31d005c5550fcb42d460acb5ce2e72ed5f9530c31a2e5d905ed2/f5" data-source="or to restore all working tree files with &lt;code&gt;top&lt;/code&gt; pathspec magic (see &lt;a href=&quot;gitglossary&quot;&gt;gitglossary[7]&lt;/a&gt;)" onmousemove="i18n(this)">&icy;&lcy;&icy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&icy;&tcy;&softcy; &vcy;&scy;&iecy; &rcy;&acy;&bcy;&ocy;&chcy;&icy;&iecy; &fcy;&acy;&jcy;&lcy;&ycy; &dcy;&iecy;&rcy;&iecy;&vcy;&acy; &scy; &pcy;&ocy;&mcy;&ocy;&shchcy;&softcy;&yucy; &mcy;&acy;&gcy;&icy;&icy; &pcy;&ucy;&tcy;&icy;  <code>top</code>  (&scy;&mcy;.  <a href="gitglossary.html">gitglossary[7]</a> )</span></p> <div> <div> <pre class="hljs language-ruby"><span class="hljs-variable">$ </span>git restore <span class="hljs-symbol">:/</span></pre> </div> </div> <p><span data-i18n="9ab7b5f03f578c5d0071ad77738a0b5f8872c6afecd7009241a4129cd1ed199e/ae" data-source="To restore a file in the index to match the version in &lt;code&gt;HEAD&lt;/code&gt; (this is the same as using &lt;a href=&quot;git-reset&quot;&gt;git-reset[1]&lt;/a&gt;)" onmousemove="i18n(this)">&CHcy;&tcy;&ocy;&bcy;&ycy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&icy;&tcy;&softcy; &fcy;&acy;&jcy;&lcy; &vcy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&iecy;, &chcy;&tcy;&ocy;&bcy;&ycy; &ocy;&ncy; &scy;&ocy;&ocy;&tcy;&vcy;&iecy;&tcy;&scy;&tcy;&vcy;&ocy;&vcy;&acy;&lcy; &vcy;&iecy;&rcy;&scy;&icy;&icy; &vcy;  <code>HEAD</code>  (&ecy;&tcy;&ocy; &tcy;&ocy; &zhcy;&iecy; &scy;&acy;&mcy;&ocy;&iecy;, &chcy;&tcy;&ocy; &icy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&ncy;&icy;&iecy;  <a href="git-reset.html">git-reset[1]</a> )</span></p> <div> <div> <pre class="hljs language-lua">$ git restore <span class="hljs-comment">--staged hello.c</span></pre> </div> </div> <p><span data-i18n="29d8bb8a54f03d23a1bb1ddbe1cba1148698e78da51489d3457287dcd5cf15f4/8f" data-source="or you can restore both the index and the working tree (this is the same as using &lt;a href=&quot;git-checkout&quot;&gt;git-checkout[1]&lt;/a&gt;)" onmousemove="i18n(this)">&icy;&lcy;&icy; &mcy;&ocy;&zhcy;&ncy;&ocy; &vcy;&ocy;&scy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&icy;&tcy;&softcy; &icy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;, &icy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&iecy; &dcy;&iecy;&rcy;&iecy;&vcy;&ocy; (&ecy;&tcy;&ocy; &tcy;&ocy; &zhcy;&iecy; &scy;&acy;&mcy;&ocy;&iecy;, &chcy;&tcy;&ocy; &icy; &pcy;&rcy;&icy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&ncy;&icy;&icy;  <a href="git-checkout.html">git-checkout[1]</a> )</span></p> <div> <div> <pre class="hljs language-shell"><span class="hljs-meta prompt_">$ </span><span class="language-bash">git restore --<span class="hljs-built_in">source</span>=HEAD --staged --worktree hello.c</span></pre> </div> </div> <p><span data-i18n="74d47a55178da2fff1b0b2dae2b70ec20b8e335cd8416ee54e551b30bf0c08a3/a9" data-source="or the short form which is more practical but less readable:" onmousemove="i18n(this)">&icy;&lcy;&icy; &kcy;&ocy;&rcy;&ocy;&tcy;&kcy;&acy;&yacy; &fcy;&ocy;&rcy;&mcy;&acy;, &kcy;&ocy;&tcy;&ocy;&rcy;&acy;&yacy; &bcy;&ocy;&lcy;&iecy;&iecy; &pcy;&rcy;&acy;&kcy;&tcy;&icy;&chcy;&ncy;&acy;, &ncy;&ocy; &mcy;&iecy;&ncy;&iecy;&iecy; &chcy;&icy;&tcy;&acy;&bcy;&iecy;&lcy;&softcy;&ncy;&acy;:</span></p> <div> <div> <pre class="hljs language-kotlin">$ git restore -<span class="hljs-symbol">s@</span> -SW hello.c</pre> </div> </div> </div> <h2 class="text-body-emphasis"  id="_see_also"><span data-i18n="2fa97693b70fa87b95b2d1bdf9558e4ac65d5e82d145f13a03849c4d9c4957a9/40" data-source="See also" onmousemove="i18n(this)">See also</span></h2> <div> <p><span data-i18n="abc12f03c86c1d813cc832752e557154dda19665b3feee46d22bc3e0c00a516d/65" data-source="&lt;a href=&quot;git-checkout&quot;&gt;git-checkout[1]&lt;/a&gt;, &lt;a href=&quot;git-reset&quot;&gt;git-reset[1]&lt;/a&gt;" onmousemove="i18n(this)"><a href="git-checkout.html">git-checkout[1]</a>, <a href="git-reset.html">git-reset[1]</a></span></p> </div><address>
<p>
    &copy; 2012&ndash;2024 Scott Chacon and others<br/>Licensed under the MIT License.<br/>
<a href="https://git-scm.com/docs/git-restore">https://git-scm.com/docs/git-restore</a>
</p>
</address>                </article>
            </main>

            <br>
            <br>
            <hr>

                               <ins class="adsbygoogle"
        style="display:block"
        data-ad-format="autorelaxed"
        data-ad-client="ca-pub-6424571640879890"
        data-ad-slot="7867651344"></ins>
   <script>
        (adsbygoogle = window.adsbygoogle || []).push({});
   </script>            
        </div>

        <!-- -->

        <div class="col-md-3">
            <br>
            <form action="-index-.html">
                <div class="input-group">
                    <input class="form-control" type="search" name="q" placeholder="Search for Git" required>
                    <button class="btn btn-primary" type="submit">
                        <i class="bi bi-search"></i>
                    </button>
                </div>
            </form>
            <br>

                            <div class="list-group list-group-flush">
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="git-rev-list.html">
                            git rev-list                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="git-rev-parse.html">
                            git rev-parse                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="git-revert.html">
                            git revert                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="git-rm.html">
                            git rm                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="git-send-email.html">
                            git send-email                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="git-send-pack.html">
                            git send-pack                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="git-sh-i18n.html">
                            git sh-i18n                        </a>
                                    </div>
            
            <br>
            <div class="my-3">
                <ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-6424571640879890"
     data-ad-slot="3954319254"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>            </div>
            <br>

            
            
        </div>
    </div>
</div>    <!--/sse-->

    <footer>
        <br>
        <div class="container">
            <div class="row">
                <div class="col">
                    <hr>
                    <div class="row">
                        <div class="col-md-10">
                            <ul class="nav">
                                <li class="nav-item">
                                    <a class="nav-link ps-0" href="https://runebook.dev/">Help us Improve Translation</a>
                                </li>
                                                            </ul>
                        </div>
                        <div class="col-md-2 text-end">
                            <a href="git-restore.html#" class="fs-5" aria-label="Top">
                                <i class="bi bi-arrow-up-square-fill"></i>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <br>
    </footer>
    <script src="../../../runebook.js"></script>
</body>

</html>